package User;

import Operations.*;

import java.util.Scanner;

public class AdminUser extends User{

    public AdminUser(String name) {
        super(name);

        operations = new Operation[] {
                new ExitOperation(),
                new ShowOperation(),
                new FindOperation(),
                new AddOperation(),
                new DeleteOperation(),
        };
    }

    public Operation getOperation(int pos) {
        return operations[pos];
    }

    public int menu() {
        System.out.println("选择你的操作");
        System.out.println("1.展示图书");
        System.out.println("2.查找图书");
        System.out.println("3.新增图书");
        System.out.println("4.删除图书");
        System.out.println("0.退出系统");

        Scanner scanner = new Scanner(System.in);

        int choice = scanner.nextInt();

        return choice;
    }
}
